package com.huwaiwai.jvm.d20200619;

import java.nio.ByteBuffer;

/**
 * @author 歪大哥😁
 * @date 2020-06-19.
 * -XX:+PrintGCDetails -Xms10m -Xmx10m -XX:+UseConcMarkSweepGC
 */
public class CMSPromotionFailedTest {

    static int _1MB = 1024 * 1024;
    static int _2MB = 2 * 1024 * 1024;


    public static void main(String[] args) throws InterruptedException {
        ByteBuffer b2 = ByteBuffer.allocate(_1MB);
        ByteBuffer b1 = ByteBuffer.allocate(_2MB);
        ByteBuffer b4 = ByteBuffer.allocate(_1MB);
        ByteBuffer b3 = ByteBuffer.allocate(_2MB);
        ByteBuffer b5 = ByteBuffer.allocate(_1MB);
        b2 = null;
        b4 = null;
        System.gc();
        ByteBuffer b6 = ByteBuffer.allocate(_2MB);
    }

}
